package com.wrh.draw.legend;

import java.util.Arrays;

/**
 * @author wrh
 */
public class Legend {

    private String legendId;

    private String des;

    private LegendTypeEnum legendType;

    private HexColor[] hexColors;

    private float[] values;

    private String[] texts;

    private String unit;

    private String name;

    public String getLegendId() {
        return legendId;
    }

    public String getDes() {
        return des;
    }

    public LegendTypeEnum getLegendType() {
        return legendType;
    }

    public HexColor[] getHexColors() {
        return hexColors;
    }

    public float[] getValues() {
        return values;
    }

    public String[] getTexts() {
        return texts;
    }

    public String getUnit() {
        return unit;
    }

    public String getName() {
        return name;
    }

    public Legend setLegendId(String legendId) {
        this.legendId = legendId;
        return this;
    }

    public Legend setDes(String des) {
        this.des = des;
        return this;
    }

    public Legend setLegendType(LegendTypeEnum legendType) {
        this.legendType = legendType;
        return this;
    }

    public Legend setHexColors(HexColor[] hexColors) {
        this.hexColors = hexColors;
        return this;
    }

    public Legend setHexColors(String... hexColors) {
        this.hexColors = HexColorUtil.getHexColorArray(hexColors);
        return this;
    }

    public Legend setValues(float[] values) {
        this.values = values;
        return this;
    }

    public Legend setValues2(float... values) {
        this.values = values;
        return this;
    }

    public Legend setTexts(String[] texts) {
        this.texts = texts;
        return this;
    }

    public Legend setTexts2(String... texts) {
        this.texts = texts;
        return this;
    }

    public Legend setUnit(String unit) {
        this.unit = unit;
        return this;
    }

    public Legend setName(String name) {
        this.name = name;
        return this;
    }


    @Override
    public String toString() {
        return "Legend{" +
                "legendId='" + legendId + '\'' +
                ", des='" + des + '\'' +
                ", legendType=" + legendType +
                ", hexColors=" + Arrays.toString(hexColors) +
                ", values=" + Arrays.toString(values) +
                ", texts=" + Arrays.toString(texts) +
                ", unit='" + unit + '\'' +
                ", name='" + name + '\'' +
                '}';
    }
}
